package com.qiao.train.controller;


import com.qiao.train.DAO.PayDAO;

import com.qiao.train.po.Pay;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/Pay")
public class PayController {
    @Autowired
    private com.qiao.train.DAO.PayDAO PayDAO;

    @GetMapping("/getAllPay")
    public List<Pay> getAllPay() {
        return PayDAO.getAllPay();
    }

    @GetMapping("/createPay")
    public int createPay(Pay Pay) {
        return PayDAO.createPay(Pay);
    }

    @GetMapping("/deletePay")
    public int deletePay(int id) {
        return PayDAO.deletePay(id);
    }

    @GetMapping("/updatePay")
    public int updatePay(Pay Pay) {
        return PayDAO.updatePay(Pay);
    }
}
